inherited dm_banco: Tdm_banco
  OldCreateOrder = True
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '  a.codigo,'
      '  a.descricao,'
      '  a.identificador,'
      '  a.data_cad,'
      '  a.data_alteracao,'
      
        '  (select count(b.cod_conta) from banco_conta b where b.lig_cod_' +
        'banco = a.codigo) as total_conta'
      'from banco a')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCODIGO: TIntegerField
      Alignment = taCenter
      FieldName = 'CODIGO'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsConsultaIDENTIFICADOR: TStringField
      Alignment = taCenter
      FieldName = 'IDENTIFICADOR'
      Required = True
      Size = 3
    end
    object cdsConsultaDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaTOTAL_CONTA: TIntegerField
      Alignment = taCenter
      FieldName = 'TOTAL_CONTA'
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_banco,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    OnReconcileError = cdsRegistroReconcileError
    object cdsRegistroCODIGO: TIntegerField
      Alignment = taCenter
      FieldName = 'CODIGO'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsRegistroIDENTIFICADOR: TStringField
      Alignment = taCenter
      FieldName = 'IDENTIFICADOR'
      Required = True
      Size = 3
    end
    object cdsRegistroDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'codigo'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '  a.codigo,'
      '  a.descricao,'
      '  a.identificador,'
      '  a.data_cad,'
      '  a.data_alteracao'
      'from BANCO a'
      'where a.codigo = :codigo')
  end
end
